package com.zx.cloud.controller.client;

import java.util.Map;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.zx.cloud.ApiVersion;
import com.zx.cloud.common.auth0.jwt.Token;
import com.zx.cloud.domain.User;
import com.zx.cloud.model.request.ManagerLoginRequest;
import com.zx.cloud.model.response.ObjectDataResponse;

import feign.Headers;


@FeignClient(name = LoginClient.SERVICE_ID, fallback = LoginClientFallBack.class)
public interface LoginClient {

	String SERVICE_ID = "trade-provider";
	
	 @Headers("X-Auth-Token:{X-Auth-Token}")
	 @RequestMapping(value =ApiVersion.PROVIDER_V1_PREFIX+"/user/login", method = RequestMethod.POST)
	 ObjectDataResponse<Token> login(ManagerLoginRequest managerLoginRequest);
	 
	 @Headers("X-Auth-Token:{X-Auth-Token}")
	 @RequestMapping(value =ApiVersion.PROVIDER_V1_PREFIX+"/user/loginFind", method = RequestMethod.POST)
	 ObjectDataResponse<User> loginFind(User user);
	 
	 @Headers("X-Auth-Token:{X-Auth-Token}")
	 @RequestMapping(value =ApiVersion.PROVIDER_V1_PREFIX+"/user/updatePassWord", method = RequestMethod.POST)
	 ObjectDataResponse<Integer> updatePassWord(User user);
	 
	 @Headers("X-Auth-Token:{X-Auth-Token}")
	 @RequestMapping(value =ApiVersion.PROVIDER_V1_PREFIX+"/user/statisticalInformation", method = RequestMethod.POST)
	 ObjectDataResponse <Map<String, Object>> statisticalInformation();
}
